package test1;

import test1.extobject.MyObject;
import test1.extthread.MyThread1;
import test1.extthread.MyThread2;
import test1.service.Service;

/**
　* @Description: TODO
　* @param ${tags}
　* @return ${return_type}
　* @throws
　* @author Merlin
　* @date 2018/6/19 10:14
　*/


public class Run {

	public static void main(String[] args) {

		Service service = new Service();
		MyObject object = new MyObject();

		MyThread1 a = new MyThread1(service,object);
		a.setName("a");
		a.start();

		MyThread2 b = new MyThread2(service,object);
		b.setName("b");
		b.start();

	}


	/**
	 * 输出结果：
	 * testMethod1______getLock time=1529657204221 run ThreadName= a
	   testMethod1______getLock time=1529657206221 run ThreadName= a
	   testMethod1______getLock time=1529657206221 run ThreadName= b
	   testMethod1______getLock time=1529657208222 run ThreadName= b
	 *
	 * 同步的原因是使用了同一个“对象监视器”如果使用不同的“对象监视器”会出现什么效果呢？
	 *
	 *
	 *
	 */
}
